//
//  NSDictionary+Normal.m
//  QuXiang
//
//  Created by Duncan on 2020/7/25.
//  Copyright © 2020 NanHuaiZi. All rights reserved.
//

#import "NSDictionary+Normal.h"

@implementation NSDictionary (Normal)

/// data转dict
+ (NSDictionary *)jsonData2Dictionary:(NSData *)jsonData {
    if (jsonData == nil) {
        return nil;
    }
    NSError *err = nil;
    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err];
    if (err || ![dic isKindOfClass:[NSDictionary class]]) {
        NSLog(@"Json parse failed");
        return nil;
    }
    return dic;
}

@end
